package com.shensi.adminCollect.service.customer.impl;

import com.shensi.adminCollect.common.utils.DateUtils;
import com.shensi.adminCollect.domain.customer.CustomerCardRecordConsumption;
import com.shensi.adminCollect.mapper.customer.CustomerCardRecordConsumptionMapper;
import com.shensi.adminCollect.service.customer.ICustomerCardRecordConsumptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户电子会员卡消费记录Service业务层处理
 * 
 * @author qujia
 * @date 2021-04-13
 */


@Service
public class CustomerCardRecordConsumptionServiceImpl implements ICustomerCardRecordConsumptionService {
    @Autowired
    private CustomerCardRecordConsumptionMapper customerCardRecordConsumptionMapper;

    /**
     * 查询客户电子会员卡消费记录
     *
     * @param id 客户电子会员卡消费记录ID
     * @return 客户电子会员卡消费记录
     */
    @Override
    public CustomerCardRecordConsumption selectCustomerCardRecordConsumptionById(Long id) {
        return customerCardRecordConsumptionMapper.selectCustomerCardRecordConsumptionById(id);
    }

    /**
     * 查询客户电子会员卡消费记录列表
     *
     * @param customerCardRecordConsumption 客户电子会员卡消费记录
     * @return 客户电子会员卡消费记录
     */
    @Override
    public List<CustomerCardRecordConsumption> selectCustomerCardRecordConsumptionList(CustomerCardRecordConsumption customerCardRecordConsumption) {
        return customerCardRecordConsumptionMapper.selectCustomerCardRecordConsumptionList(customerCardRecordConsumption);
    }

    /**
     * 新增客户电子会员卡消费记录
     *
     * @param customerCardRecordConsumption 客户电子会员卡消费记录
     * @return 结果
     */
    @Override
    public int insertCustomerCardRecordConsumption(CustomerCardRecordConsumption customerCardRecordConsumption) {
        customerCardRecordConsumption.setCreateTime(DateUtils.getNowDate());
        return customerCardRecordConsumptionMapper.insertCustomerCardRecordConsumption(customerCardRecordConsumption);
    }

    /**
     * 修改客户电子会员卡消费记录
     *
     * @param customerCardRecordConsumption 客户电子会员卡消费记录
     * @return 结果
     */
    @Override
    public int updateCustomerCardRecordConsumption(CustomerCardRecordConsumption customerCardRecordConsumption) {
        return customerCardRecordConsumptionMapper.updateCustomerCardRecordConsumption(customerCardRecordConsumption);
    }

    /**
     * 批量删除客户电子会员卡消费记录
     *
     * @param ids 需要删除的客户电子会员卡消费记录ID
     * @return 结果
     */
    @Override
    public int deleteCustomerCardRecordConsumptionByIds(Long[] ids) {
        return customerCardRecordConsumptionMapper.deleteCustomerCardRecordConsumptionByIds(ids);
    }

    /**
     * 删除客户电子会员卡消费记录信息
     *
     * @param id 客户电子会员卡消费记录ID
     * @return 结果
     */
    @Override
    public int deleteCustomerCardRecordConsumptionById(Long id) {
        return customerCardRecordConsumptionMapper.deleteCustomerCardRecordConsumptionById(id);
    }

    /**
     * 获取客户电子会员卡消费汇总金额
     */
    @Override
    public CustomerCardRecordConsumption xfAmtQuery(CustomerCardRecordConsumption customerCardRecordConsumption) {
        return customerCardRecordConsumptionMapper.xfAmtQuery(customerCardRecordConsumption);
    }

    /**
     * 获取客户电子会员卡消费汇总折线图x轴数据
     */
    @Override
    public List<CustomerCardRecordConsumption> listXdata(CustomerCardRecordConsumption customerCardRecordConsumption) {
        return customerCardRecordConsumptionMapper.listXdata(customerCardRecordConsumption);
    }

    /**
     * 获取客户电子会员卡消费汇总折线图x轴数据
     */
    @Override
    public List<CustomerCardRecordConsumption> listQydataXF(CustomerCardRecordConsumption customerCardRecordConsumption) {
        return customerCardRecordConsumptionMapper.listQydataXF(customerCardRecordConsumption);
    }

    @Override
    public CustomerCardRecordConsumption listXFData(CustomerCardRecordConsumption customerCardRecordConsumption) {
        return customerCardRecordConsumptionMapper.listXFData(customerCardRecordConsumption);
    }

}